#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl "\n"

const double EPS=1e-15;

int sign(double x){return x<-EPS ? -1 : x > EPS;}

struct Point{
    double x,y,dis1;
    Point(double x=0,double y=0,double dis1=0):x(x),y(y),dis1(dis1){}
    Point operator+(const Point&p)const{return Point(x+p.x,y+p.y);}
    Point operator-(const Point&p)const{return Point(x-p.x,y-p.y);}
    Point operator*(double k)const{return Point(x*k,y*k);}
    Point operator/(double k)const{return Point(x/k,y/k);}

    double cross(const Point& p)const{return x*p.y-y*p.x;}
    double norm() const{return sqrt(x*x+y*y);}
};

bool cmp(const Point& p1,const Point& p2){
    return p1.dis1<p2.dis1;
}

struct Segment{
    Point p1,p2;
};

double dis(Point p,const Segment& L){
    Point a=L.p1,b=L.p2;
    Point ab = b-a;
    Point ap = p-a;
    return abs(ap.cross(ab))/ab.norm();
}

void solve(){
    int n,a,b;
    cin>>n;
    vector<Point> p;
    for(int i=0;i<n;i++){
        cin>>a>>b;
        p.push_back({a,b,0});
    }
    double minn=0;
    vector<Point> p1;
    Segment x1={{0,-2e9},{2e9,0}};
    for(int i=0;i<n;i++){
        p1.push_back({p[i].x,p[i].y,dis(p[i],x1)});
    }
    sort(p1.begin(),p1.end(),cmp);
    
    for(int i=1;i<n;i++){
        double dis2=(abs(p1[i].x-p1[i-1].x)+abs(p1[i].y-p1[i-1].y))/(sqrt((p1[i].x-p1[i-1].x)*(p1[i].x-p1[i-1].x)+(p1[i].y-p1[i-1].y)*(p1[i].y-p1[i-1].y)));
        minn=max(minn,dis2);
    }
    p1.clear();
    x1={{0,-2e9},{-2e9,0}};
    for(int i=0;i<n;i++){
        p1.push_back({p[i].x,p[i].y,dis(p[i],x1)});
    }
    sort(p1.begin(),p1.end(),cmp);
    
    for(int i=1;i<n;i++){
        double dis2=(abs(p1[i].x-p1[i-1].x)+abs(p1[i].y-p1[i-1].y))/(sqrt((p1[i].x-p1[i-1].x)*(p1[i].x-p1[i-1].x)+(p1[i].y-p1[i-1].y)*(p1[i].y-p1[i-1].y)));
        minn=max(minn,dis2);
    }
    cout<<fixed<<setprecision(13)<<minn<<'\n';
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    int _=1;
    cin>>_;
    while(_--){
        solve();
    }
    return 0;
}